Skip to content

Introduce a reconnect_max_tries setting for NUT drivers - #3541

Open
jimklimov wants to merge 24 commits into
networkupstools:masterfrom
jimklimov:issue-3540
Open

Introduce a reconnect_max_tries setting for NUT drivers#3541
jimklimov wants to merge 24 commits into
networkupstools:masterfrom
jimklimov:issue-3540

Conversation

@jimklimov

@jimklimov jimklimov commented Jul 23, 2026

Copy link
Copy Markdown
Member

Exit the driver after the counter expires, so someone else can restart it from scratch. Optional, not default.

Might help with numerous reports of reconnection loops, especially if taking advantage of systemd units with a drop-in usb_resetter call, such as recent #3531 and a couple dozen before it over the years.

NOTE: As of initial posting, some drivers may still have their own mechanisms to limit the amount of retries, and to report the reconnection attempts and results (and throttle such reporting). It is possible that while this PR brings consistency to the related code base in general, it would cause confusing messages in some drivers reporting similar things twice, etc. Some apparent locations were marked with TODO in the code, others might be discovered later. Cleaning that up is not necessarily a focus of this PR, but might be if it proves easy.

@jimklimov jimklimov added this to the 2.8.6 milestone Jul 23, 2026
@jimklimov jimklimov added enhancement service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug labels Jul 23, 2026
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

A ZIP file with standard source tarball and another tarball with pre-built docs for commit 9e94a53 is temporarily available: NUT-tarballs-PR-3541.zip.

jimklimov added a commit to jimklimov/nut that referenced this pull request Jul 23, 2026
….adoc: introduce `reconnect_max_tries` setting for NUT drivers [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov
jimklimov marked this pull request as draft July 23, 2026 20:03
@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.4975-master completed (commit 45ab5bdb79 by @jimklimov)

@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.4976-master completed (commit 8a56bf4a6c by @jimklimov)

jimklimov added a commit to jimklimov/nut that referenced this pull request Jul 24, 2026
….adoc: introduce `reconnect_max_tries` setting for NUT drivers [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.4979-master completed (commit 3f1ca8c5f3 by @jimklimov)

jimklimov added a commit to jimklimov/nut that referenced this pull request Jul 24, 2026
….adoc: introduce `reconnect_max_tries` setting for NUT drivers [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@AppVeyorBot

Copy link
Copy Markdown

@AppVeyorBot

Copy link
Copy Markdown

jimklimov added a commit to jimklimov/nut that referenced this pull request Jul 24, 2026
….adoc: introduce `reconnect_max_tries` setting for NUT drivers [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit to jimklimov/nut that referenced this pull request Jul 24, 2026
…s "reconnect.updateinfo" [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit to jimklimov/nut that referenced this pull request Jul 24, 2026
…te_t as enum with symbolic names instead of magic numbers [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit to jimklimov/nut that referenced this pull request Jul 24, 2026
jimklimov added a commit to jimklimov/nut that referenced this pull request Jul 24, 2026
… enum arg values for consistent reporting [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Comment thread drivers/main.c Dismissed
Comment thread drivers/powervar_cx_usb.c Fixed
Comment thread drivers/richcomm_usb.c Fixed
Comment thread drivers/richcomm_usb.c Fixed
Comment thread drivers/tripplite_usb.c Fixed
@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.4981-master completed (commit 3f11131b0d by @jimklimov)

@AppVeyorBot

Copy link
Copy Markdown

jimklimov added a commit to jimklimov/nut that referenced this pull request Jul 25, 2026
….adoc: introduce `reconnect_max_tries` setting for NUT drivers [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit to jimklimov/nut that referenced this pull request Jul 25, 2026
…s "reconnect.updateinfo" [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit to jimklimov/nut that referenced this pull request Jul 25, 2026
…te_t as enum with symbolic names instead of magic numbers [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit to jimklimov/nut that referenced this pull request Jul 25, 2026
jimklimov added 20 commits July 27, 2026 14:27
…s "reconnect.updateinfo" [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…te_t as enum with symbolic names instead of magic numbers [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… enum arg values for consistent reporting [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…s#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
….c [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ction limit tracking [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ion limit tracking [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…e reconnect_report_freq to manage verbosity of on-going reconnect_trying() streak [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…that retain custom logging of reconnection details for now [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…nd may_log_reconnect_trying() [networkupstools#3541]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@AppVeyorBot

Copy link
Copy Markdown

@AppVeyorBot

Copy link
Copy Markdown

@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.4990-master completed (commit ded935d53b by @jimklimov)

@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.4993-master completed (commit e935c2b6e8 by @jimklimov)

@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.4999-master completed (commit 7b0aab8d28 by @jimklimov)

@AppVeyorBot

Copy link
Copy Markdown

@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.5000-master completed (commit 82ad419919 by @jimklimov)

@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.5002-master completed (commit 85bcbb9d33 by @jimklimov)

@AppVeyorBot

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants